Skip to content

core(driver): checkForQuiet bugfix to properly handle setTimeout() #16155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

aguidrevitch
Copy link

Summary

The PR fixes unhandled rejections which happen in setTimeout(checkForQuiet).

It is a bugfix.

When target page gets closed during waitForCPUIdle, lighthouse crashes.

@adamraine
Copy link
Member

When target page gets closed during waitForCPUIdle, lighthouse crashes.

Can you describe this bug in a bit more detail? If the target page is closed then a crash seems perfectly reasonable to me.

@aguidrevitch
Copy link
Author

When target page gets closed during waitForCPUIdle, lighthouse crashes.

Can you describe this bug in a bit more detail? If the target page is closed then a crash seems perfectly reasonable to me.

In my particular case, I'm not using lighthouse as a cli tool, I'm calling gotoURL() directly, so I want to handle this exception gracefully and wind down correctly. Right now - node just exits.

@adamraine
Copy link
Member

Using gotoURL directly isn't something we officially support

@paulirish
Copy link
Member

@aguidrevitch is this still a problem for you?

While the fix here looks reasonable, we have some hesitance about introducing changes to such a core part of our workflow and we're not ready to absorb the maintenance fallout. So we're going to reject this for now, but if we are revisiting this file, we'll likely try pulling this in during a larger refactor.

Apologies and thank you.

@paulirish paulirish closed this Jun 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants